<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS3书写三角</title>
    <style>
        div {
            position: relative;
            width: 249px;
            height: 35px;
            border: 1px solid #000;
        }

        div::after {
            position:absolute;
            top: 50%;
            right: 10px;
            margin-top: -7px;
            content: "";
            width: 10px;
            height: 10px;
            border-right: 1px solid #000;
            border-bottom: 1px solid #000;
            transform: rotate(45deg);
            /* 过渡 */
            transition:all .2s;
        }

        div:hover::after{
            transform: rotate(225deg);
            margin-top: -4px;
        }
    </style>
</head>
<body>
    <div></div>
</body>
</html>